***** Replication code for Franchino, Fabio, and Camilla Mariotto. “Noncompliance Risk, Asymmetric Power and the Design of Enforcement of the European Economic Governance”. European Union Politics.

***** Online Appendix Section 5. Financial assistance and enforcement preferences
* Table A11: Governmental positions on national discretion and enforcement regimes with an indicator variable for financially assisted governments
version 15
pause on
use conflict_data_FC2.dta, clear

* Generalized structural equation model: Three-levels, Random intercepts (Table 1)
gsem (discr_com <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.debt_gdp                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ), vce(robust) nolog

drop if e(sample)!=1 /* Drop deleted observations */

matrix b = e(b)

* Adding Financial Assistance data
* Negotiation dates
* Corrective SGP 1997 Date of proposal (DoP) 6.12.1996 - Date of adoption (DoA) 7.7.1997
* EDP 2005 DoP 2.3.2005 - DoA 12.12.2005
* Corrective SGP 2005 DoP 20.4.2005 - DoA 27.6.2005
* Preventive SGP 2011 DoP 29.9.2010 - DoA  16.11.2011
* Corrective SGP 2011 DoP 29.9.2010 - DoA  8.11.2011
* Enforcement SGP 2011 DoP 29.9.2010 - DoA  16.11.2011
* Fiscal Compact DoP (European Council meeting) 9.12.2011 - Signed 2.03.2012
* Six pack/fiscal compact negotiation period from 09.2010 to 03.2012
* EU financial assistance periods
* https://ec.europa.eu/info/business-economy-euro/economic-and-fiscal-policy-coordination/eu-financial-assistance/which-eu-countries-have-received-assistance_en
gen fin_ass=0
*	Cyprus:  24 April 2013 - 31 March 2016 - no overlap - request for assistance 25 June 2012
replace fin_ass=1 if year>=2013 & year<=2016 & country== 16
*	Greece: 2 May 2010 – 21 Aug 2018 - first request for assistance 2 May 2010
replace fin_ass=1 if year>=2010 & year<=2018 & country== 10
*	Hungary: 4 November 2008 -31 November 2010 - request for assistance October 2008
* On 21 November 2011, Hungary requested a second (precautionary) financial assistance - negotiations were limited to 1 official round from 17 to 25 July 2012 
replace fin_ass=1 if year>=2008 & year<=2012 & country== 19
*	Ireland: 1 December 2010 -31 December 2013 - request for assistance in late 2010
replace fin_ass=1 if year>=2010 & year<=2013 & country== 8
*	Latvia: 20 January 2009 – 19 January 2012 - request for assistance in late 2008
replace fin_ass=1 if year>=2009 & year<=2012 & country== 20
*	Portugal: 17 May 2011 -12 June 2014 - request for assistance on 7 April 2011
replace fin_ass=1 if year>=2011 & year<=2014 & country== 11
*	Romania: 5 May 2009 – 30 September 2015 - request for assistance in spring 2009
replace fin_ass=1 if year>=2009 & year<=2015 & country== 27
*	Spain: 23 July 2012 – 22 January 2014 - no overlap - request in June 2012
replace fin_ass=1 if year>2012 & year<=2014 & country== 12

* Table A11: Governmental positions on national discretion and enforcement regimes with an indicator variable for financially assisted governments
gsem (discr_com <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s  i.fin_ass M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s  i.fin_ass M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.debt_gdp                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s  i.fin_ass M1[act] M2[act>issue_id], ologit ), vce(robust) nolog from(b)
	 
 
pause /* type q to proceed */

* Effects of financial assistance
margins, dydx(fin_ass)
* probability of discr_cou = less , middle, more is -13%, -0.0%, +13% for financially assisted governments, all other predictors are set at their mean values
* probability of discr_com = less , middle, more is +19%, -0.0%, -19% for financially assisted governments, all other predictors are set at their mean values

pause /* type q to proceed */

* Figure A7: Marginal effect of noncompliance risk on preferring Council involvement, over voting power from the model in Table A11
* Substantive effects: Council Discretion
* Code from Thomas Brambor, William Roberts Clark, Matt Golder, Political Analysis 14: 63-82)
matrix b=e(b)
matrix list b
scalar b19=b[1,19]
scalar b21=b[1,21]
sca dir
matrix V=e(V)
matrix list V
scalar varb19=V[19,19]
scalar varb21=V[21,21]
scalar covb19b21=V[19,21]
sca dir
generate MVZ=(_n+8)/10
replace  MVZ=. if _n>123
gen conbx=b19+b21*MVZ if _n<=123
gen consx=sqrt(varb19+varb21*(MVZ^2)+2*covb19b21*MVZ) if _n<=123
gen ax=1.96*consx
gen upperx=conbx+ax
gen lowerx=conbx-ax
gen where=-0.14 
gen pipe = "|" 
egen tag_nbi = tag(nbi)
gen yline=0
graph twoway hist nbi, width(0.5) percent color(gs14) yaxis(2) ///
		|| scatter where nbi if tag_nbi, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off)  ///
		||   line conbx   MVZ, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1)  ///
        ||   line upperx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line lowerx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line yline  MVZ,  clwidth(thin) clcolor(black) clpattern(solid) || , ///
			 xlabel(1 5 10, noticks nogrid labsize(2)) xscale(noline) ylabel( 0 0.5 1 1.5, noticks axis(1) nogrid labsize(2))  ///
		     ylabel(0 5 10 15, noticks axis(2) nogrid labsize(2)) yscale(noline alt) yscale(noline alt axis(2)) legend(off) ///			 
			 title("" , size(2.5)) xtitle("Voting power (%)" , size(2.5)) ytitle("Marginal effect of {it:noncompliance risk}" , axis(1) size(2.5)) ytitle("" , axis(2) size(2.5)) ///
			 xsca(titlegap(2) r(0.3 1.5)) ysca(titlegap(2)) scheme(s2mono) graphregion(fcolor(white) ilcolor(white) lcolor(white)) saving(figureA7, replace)

